using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Text;
using System.Windows.Forms;

namespace worktime
{
    public partial class FormLeave : Form
    {
		public enum AwayStatuses
		{
            None,
			FeatureLockIsAway,
			LastLockWereAway,
			TimeInterval
		}

		private AwayStatuses _status = AwayStatuses.None;

		public AwayStatuses Status
		{
			get
			{
				return _status;
			}
		}

        public FormLeave()
        {
            InitializeComponent();
        }

        private void CheckState()
        {
            timepanel.Visible = rbEnterTime.Checked;
        }

        private void rbIWillPressButton_CheckedChanged(object sender, EventArgs e)
        {
            CheckState();
        }

        private void rbEnterTime_CheckedChanged(object sender, EventArgs e)
        {
            CheckState();
        }

        private void rbByBlocking_CheckedChanged(object sender, EventArgs e)
        {
            CheckState();
        }

        private void btnCancel_Click(object sender, EventArgs e)
        {
            this.Hide();
        }

        private void btnOk_Click(object sender, EventArgs e)
        {
            this.Close();

			if (rbEnterTime.Checked)
			{
				_status = AwayStatuses.TimeInterval;
			}
			else if (rbByBlocking.Checked)
			{
				_status = AwayStatuses.FeatureLockIsAway;
			}
			else if (rbLastLockWereAway.Checked)
			{
				_status = AwayStatuses.LastLockWereAway;
			}
        }
    }
}